package globals;

import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import java.util.List;
import java.util.Map;

import network.DataPackage;
import network.NetworkManager;

import attack.Attack;

import gameClass.Camera;
import gameClass.MapChunk;
import gameClass.PlayerCharacter;
import gameClass.TileMap;
import gameTypes.Vector2;
import screen.*;

/**
 * @author Ben Elliott
 */
public class Global {
	private static final Global instance = new Global(); 
	
	/*  Program Globals  */
	public int winWidth = 800;
	public int winHeight = 600;
	public int fps;
	
	/*  Game Globals  */
	public PlayerCharacter player;
	public final int tileSize = 16;
	public final int chunkSize = 2;
	public final int MAX_ENTRIES = 42;
	public boolean gameRunning;
	public ScreenType currentScreen;
	public InputManager input;
	public Camera camera;
	public ImageObserver imgObs;
	public TileMap tileMap;
	public NetworkManager networkManager;
	public int port = 2406;
	public Map<Vector2, MapChunk> chunks;
	
	/* Screens */
	public GameScreen gameScreen;
	public MenuScreen menuScreen;
	public LoadScreen loadScreen;
	public InterfaceScreen interfaceScreen;
	public LoginScreen loginScreen;
	
	/* Layout */
	public int INTERFACE_BORDER = 8;
	
	/* Player Variables */
	public String username;
	public Attack leftClick;
	public List<DataPackage> others;
	
	/*  Textures  */
	public BufferedImage playerSheet;
	public BufferedImage tileSheet;
	public List<BufferedImage> tileImages;
	
	private Global() {
	}

	/**
	 * @return The singleton instance of globals. 
	 */
	public static Global Instance() {
		return instance;
	}
}
